
// 广度优先 队列
function bfs(node:Node) {
    let queue:Node[] = [];
    queue.push(node);

    while(queue.length){
        let currNode = queue.shift();
        currNode.visited =  true;

        process(currNode);

        let nodes:Node[] = generateRelatedNodes(currNode);

        queue.push(...nodes)
    }
    // other process
}